Skip to content

Conversation

@lionelkusch
Copy link
Collaborator

@lionelkusch lionelkusch commented Aug 28, 2025

This PR is based on 366 361

@codecov
Copy link

codecov bot commented Aug 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.73%. Comparing base (3ecce71) to head (d7832e9).

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #359      +/-   ##
==========================================
+ Coverage   98.10%   99.73%   +1.62%     
==========================================
  Files          22       20       -2     
  Lines        1161     1120      -41     
==========================================
- Hits         1139     1117      -22     
+ Misses         22        3      -19     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@bthirion bthirion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused by the fact that this includes a big diff.
I made some comments specific to the CRT part.

self.n_repeat, -1
)

self.importances_ = np.mean(np.abs(self.test_scores_), axis=0)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand whuy you take an absolute value here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I take the absolute value because there is no guarantee that the test_score is always positive or negative.
In consequence, taking the mean can give a value close to zeros just because there is a switch between positive and negative values, which is, for me, not a desirable behaviour.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would take the absolute value after the mean, not before. I do agree that the importance measure should only take into account the fact that there is an effect, not that it is negative or positive. However, by taking the absolute value before the mean you are not reducing the bias. If you take the absolute value after the mean, as the importance should be centered around 0 as it is just noise, we are going to reduce the variance and achieve better importance discrimination.

@lionelkusch
Copy link
Collaborator Author

I'm confused by the fact that this includes a big diff. I made some comments specific to the CRT part.

You should read the description.
It's a draught PR based on 2 PR #366 and #361.
I didn't ask you to review it for the moment.

@lionelkusch lionelkusch added the API 2 Refactoring following the second version of API label Sep 9, 2025
@AngelReyero
Copy link
Collaborator

The sampler of the CRT is simpler than the one of the Knockoffs. For the Knockoffs there is need to have sequential sampler (in practice, for the Gaussian sampler, optimize the parameter s). For the CRT (similarly as with the CFI), it can be done in parallel.

@AngelReyero
Copy link
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

API 2 Refactoring following the second version of API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants